\(\int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx\) [1546]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 69 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {(b d-a e) (a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b^2}+\frac {e \left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2} \]

[Out]

1/3*e*(b^2*x^2+2*a*b*x+a^2)^(3/2)/b^2+1/2*(-a*e+b*d)*(b*x+a)*((b*x+a)^2)^(1/2)/b^2

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {654, 623} \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {(a+b x) \sqrt {a^2+2 a b x+b^2 x^2} (b d-a e)}{2 b^2}+\frac {e \left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2} \]

[In]

Int[(d + e*x)*Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

((b*d - a*e)*(a + b*x)*Sqrt[a^2 + 2*a*b*x + b^2*x^2])/(2*b^2) + (e*(a^2 + 2*a*b*x + b^2*x^2)^(3/2))/(3*b^2)

Rule 623

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^p/(2*c*(2*p + 1)
)), x] /; FreeQ[{a, b, c, p}, x] && EqQ[b^2 - 4*a*c, 0] && NeQ[p, -2^(-1)]

Rule 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {e \left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2}+\frac {\left (2 b^2 d-2 a b e\right ) \int \sqrt {a^2+2 a b x+b^2 x^2} \, dx}{2 b^2} \\ & = \frac {(b d-a e) (a+b x) \sqrt {a^2+2 a b x+b^2 x^2}}{2 b^2}+\frac {e \left (a^2+2 a b x+b^2 x^2\right )^{3/2}}{3 b^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.55 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.32 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {x (3 a (2 d+e x)+b x (3 d+2 e x)) \left (\sqrt {a^2} b x+a \left (\sqrt {a^2}-\sqrt {(a+b x)^2}\right )\right )}{-6 a^2-6 a b x+6 \sqrt {a^2} \sqrt {(a+b x)^2}} \]

[In]

Integrate[(d + e*x)*Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]

[Out]

(x*(3*a*(2*d + e*x) + b*x*(3*d + 2*e*x))*(Sqrt[a^2]*b*x + a*(Sqrt[a^2] - Sqrt[(a + b*x)^2])))/(-6*a^2 - 6*a*b*
x + 6*Sqrt[a^2]*Sqrt[(a + b*x)^2])

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 2.

Time = 0.24 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.46

method result size
default \(-\frac {\operatorname {csgn}\left (b x +a \right ) \left (b x +a \right )^{2} \left (-2 b e x +a e -3 b d \right )}{6 b^{2}}\) \(32\)
gosper \(\frac {x \left (2 b e \,x^{2}+3 a e x +3 b d x +6 a d \right ) \sqrt {\left (b x +a \right )^{2}}}{6 b x +6 a}\) \(42\)
risch \(\frac {\sqrt {\left (b x +a \right )^{2}}\, b e \,x^{3}}{3 b x +3 a}+\frac {\sqrt {\left (b x +a \right )^{2}}\, \left (a e +b d \right ) x^{2}}{2 b x +2 a}+\frac {\sqrt {\left (b x +a \right )^{2}}\, a d x}{b x +a}\) \(73\)

[In]

int((e*x+d)*((b*x+a)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/6*csgn(b*x+a)*(b*x+a)^2*(-2*b*e*x+a*e-3*b*d)/b^2

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.35 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{3} \, b e x^{3} + a d x + \frac {1}{2} \, {\left (b d + a e\right )} x^{2} \]

[In]

integrate((e*x+d)*((b*x+a)^2)^(1/2),x, algorithm="fricas")

[Out]

1/3*b*e*x^3 + a*d*x + 1/2*(b*d + a*e)*x^2

Sympy [A] (verification not implemented)

Time = 1.01 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.26 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=d \left (\begin {cases} \left (\frac {a}{2 b} + \frac {x}{2}\right ) \sqrt {a^{2} + 2 a b x + b^{2} x^{2}} & \text {for}\: b^{2} \neq 0 \\\frac {\left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3 a b} & \text {for}\: a b \neq 0 \\x \sqrt {a^{2}} & \text {otherwise} \end {cases}\right ) + e \left (\begin {cases} \sqrt {a^{2} + 2 a b x + b^{2} x^{2}} \left (- \frac {a^{2}}{6 b^{2}} + \frac {a x}{6 b} + \frac {x^{2}}{3}\right ) & \text {for}\: b^{2} \neq 0 \\\frac {- \frac {a^{2} \left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3} + \frac {\left (a^{2} + 2 a b x\right )^{\frac {5}{2}}}{5}}{2 a^{2} b^{2}} & \text {for}\: a b \neq 0 \\\frac {x^{2} \sqrt {a^{2}}}{2} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((e*x+d)*((b*x+a)**2)**(1/2),x)

[Out]

d*Piecewise(((a/(2*b) + x/2)*sqrt(a**2 + 2*a*b*x + b**2*x**2), Ne(b**2, 0)), ((a**2 + 2*a*b*x)**(3/2)/(3*a*b),
 Ne(a*b, 0)), (x*sqrt(a**2), True)) + e*Piecewise((sqrt(a**2 + 2*a*b*x + b**2*x**2)*(-a**2/(6*b**2) + a*x/(6*b
) + x**2/3), Ne(b**2, 0)), ((-a**2*(a**2 + 2*a*b*x)**(3/2)/3 + (a**2 + 2*a*b*x)**(5/2)/5)/(2*a**2*b**2), Ne(a*
b, 0)), (x**2*sqrt(a**2)/2, True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 125 vs. \(2 (52) = 104\).

Time = 0.20 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.81 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{2} \, \sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} d x - \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a e x}{2 \, b} + \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a d}{2 \, b} - \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} a^{2} e}{2 \, b^{2}} + \frac {{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )}^{\frac {3}{2}} e}{3 \, b^{2}} \]

[In]

integrate((e*x+d)*((b*x+a)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*d*x - 1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*a*e*x/b + 1/2*sqrt(b^2*x^2 + 2*a*b*x
 + a^2)*a*d/b - 1/2*sqrt(b^2*x^2 + 2*a*b*x + a^2)*a^2*e/b^2 + 1/3*(b^2*x^2 + 2*a*b*x + a^2)^(3/2)*e/b^2

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.09 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {1}{3} \, b e x^{3} \mathrm {sgn}\left (b x + a\right ) + \frac {1}{2} \, b d x^{2} \mathrm {sgn}\left (b x + a\right ) + \frac {1}{2} \, a e x^{2} \mathrm {sgn}\left (b x + a\right ) + a d x \mathrm {sgn}\left (b x + a\right ) + \frac {{\left (3 \, a^{2} b d - a^{3} e\right )} \mathrm {sgn}\left (b x + a\right )}{6 \, b^{2}} \]

[In]

integrate((e*x+d)*((b*x+a)^2)^(1/2),x, algorithm="giac")

[Out]

1/3*b*e*x^3*sgn(b*x + a) + 1/2*b*d*x^2*sgn(b*x + a) + 1/2*a*e*x^2*sgn(b*x + a) + a*d*x*sgn(b*x + a) + 1/6*(3*a
^2*b*d - a^3*e)*sgn(b*x + a)/b^2

Mupad [B] (verification not implemented)

Time = 9.88 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.12 \[ \int (d+e x) \sqrt {a^2+2 a b x+b^2 x^2} \, dx=\frac {e\,\left (8\,b^2\,\left (a^2+b^2\,x^2\right )-12\,a^2\,b^2+4\,a\,b^3\,x\right )\,\sqrt {a^2+2\,a\,b\,x+b^2\,x^2}}{24\,b^4}+\frac {d\,\sqrt {{\left (a+b\,x\right )}^2}\,\left (a+b\,x\right )}{2\,b} \]

[In]

int(((a + b*x)^2)^(1/2)*(d + e*x),x)

[Out]

(e*(8*b^2*(a^2 + b^2*x^2) - 12*a^2*b^2 + 4*a*b^3*x)*(a^2 + b^2*x^2 + 2*a*b*x)^(1/2))/(24*b^4) + (d*((a + b*x)^
2)^(1/2)*(a + b*x))/(2*b)